/*
 * @lc app=leetcode.cn id=1436 lang=javascript
 *
 * [1436] 旅行终点站
 */

// @lc code=start
/**
 * @param {string[][]} paths
 * @return {string}
 */
var destCity = function (paths) {
  const starts = [], ends = [];
  paths.forEach(([start, end]) => {
    starts.push(start);
    ends.push(end);
  })
  return ends.filter(end => !starts.includes(end))[0];
};
// @lc code=end

